<?php

use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;

class PermissionSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        DB::table('permissions')->truncate();

        $sort = 1;
        /************************** 系统公用权限 *******************************/

        /* 增加设置权限 */
        $pid = DB::table('permissions')->insertGetId([
            'id' =>1,
            'pid' => 0,
            'title' => '设置',
            'name' => '',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '系统设置',
            'name' => 'setting/app',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '站点设置',
            'name' => 'setting/site',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);


        /* 增加管理员权限 */
        $pid = DB::table('permissions')->insertGetId([
            'pid' => 0,
            'title' => '管理员管理',
            'name' => '',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '管理员列表',
            'name' => 'manager/index',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '新增管理员',
            'name' => 'manager/add',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '编辑管理员',
            'name' => 'manager/edit',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '删除管理员',
            'name' => 'manager/delete',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '查看管理员',
            'name' => 'manager/view',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);

        /* 角色权限 */
        $pid = DB::table('permissions')->insertGetId([
            'pid' => 0,
            'title' => '角色管理',
            'name' => '',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '角色列表',
            'name' => 'role/index',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '新增角色',
            'name' => 'role/add',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '编辑角色',
            'name' => 'role/edit',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '删除角色',
            'name' => 'role/delete',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '查看角色',
            'name' => 'role/view',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '授权角色',
            'name' => 'role/permission',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);

        /* 菜单权限*/
        $pid = DB::table('permissions')->insertGetId([
            'pid' => 0,
            'title' => '菜单管理',
            'name' => '',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '菜单列表',
            'name' => 'menu/index',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '新增菜单',
            'name' => 'menu/add',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '编辑菜单',
            'name' => 'menu/edit',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '删除菜单',
            'name' => 'menu/delete',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '查看菜单',
            'name' => 'menu/view',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);

        /* 字典管理*/
        $pid = DB::table('permissions')->insertGetId([
            'pid' => 0,
            'title' => '字典管理',
            'name' => '',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '字典列表',
            'name' => 'map/index',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '新增字典',
            'name' => 'map/add',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '编辑字典',
            'name' => 'map/edit',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '删除字典',
            'name' => 'map/delete',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '查看字典',
            'name' => 'map/data',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '新增字典',
            'name' => 'map/add_data',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '编辑字典',
            'name' => 'map/edit_data',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '删除菜单',
            'name' => 'map/delete_data',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);

        /************************** 系统定制权限 *******************************/

        /* 老师管理权限*/
        $pid = DB::table('permissions')->insertGetId([
            'pid' => 0,
            'title' => '老师管理',
            'name' => '',            
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '老师头衔列表',
            'name' => 'teacherLevel/index',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '新增老师头衔',
            'name' => 'teacherLevel/add',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '编辑老师头衔',
            'name' => 'teacherLevel/edit',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '删除老师头衔',
            'name' => 'teacherLevel/delete',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '任课老师列表',
            'name' => 'teacher/index',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '新增任课老师',
            'name' => 'teacher/add',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '编辑任课老师',
            'name' => 'teacher/edit',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '删除任课老师',
            'name' => 'teacher/delete',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '后勤老师列表',
            'name' => 'logistics/index',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '新增后勤老师',
            'name' => 'logistics/add',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '编辑后勤老师',
            'name' => 'logistics/edit',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '删除后勤老师',
            'name' => 'logistics/delete',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '班主任列表',
            'name' => 'classTeacher/index',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '新增班主任',
            'name' => 'classTeacher/add',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '删除班主任',
            'name' => 'classTeacher/delete',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);

        /* 课程管理权限*/
        $pid = DB::table('permissions')->insertGetId([
            'pid' => 0,
            'title' => '课程管理',
            'name' => '',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '课程列表',
            'name' => 'lesson/index',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '新增课程',
            'name' => 'lesson/add',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '编辑课程',
            'name' => 'lesson/edit',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '删除课程',
            'name' => 'lesson/delete',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);

        /* 学校设备管理*/
        $pid = DB::table('permissions')->insertGetId([
            'pid' => 0,
            'title' => '课程表管理',
            'name' => '',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '查看课程表',
            'name' => 'classLessonTeacher/index',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '添加课程表',
            'name' => 'classLessonTeacher/add',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '编辑课程表',
            'name' => 'classLessonTeacher/edit',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '删除课程表',
            'name' => 'classLessonTeacher/delete',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);

        /* 班级管理权限*/
        $pid = DB::table('permissions')->insertGetId([
            'pid' => 0,
            'title' => '班级管理',
            'name' => '',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '班级列表',
            'name' => 'classes/index',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);

        /* 学生管理权限*/
        $pid = DB::table('permissions')->insertGetId([
            'pid' => 0,
            'title' => '学生管理',
            'name' => '',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '学生列表',
            'name' => 'student/index',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '添加学生',
            'name' => 'student/add',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '编辑学生',
            'name' => 'student/edit',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '删除学生',
            'name' => 'student/delete',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);

        /* 心理健康管理*/
        $pid = DB::table('permissions')->insertGetId([
            'pid' => 0,
            'title' => '心理健康管理',
            'name' => '',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '心理健康分类',
            'name' => 'mental/index',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '心理健康记录',
            'name' => 'mental/record',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '心理健康记录导出',
            'name' => 'mental/export',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        /* 异常行为管理*/
        $pid = DB::table('permissions')->insertGetId([
            'pid' => 0,
            'title' => '异常行为管理',
            'name' => '',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '异常行为属性',
            'name' => 'abnormal/index',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '异常行为分类',
            'name' => 'abnormal/type',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '异常行为记录',
            'name' => 'abnormal/record',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '异常行为记录导出',
            'name' => 'abnormal/export',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        /* 勤奋指数管理*/
        $pid = DB::table('permissions')->insertGetId([
            'pid' => 0,
            'title' => '勤奋指数管理',
            'name' => '',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '勤奋指数分类',
            'name' => 'viewTime/index',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '勤奋指数记录',
            'name' => 'viewTime/record',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '勤奋指数记录导出',
            'name' => 'viewTime/export',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        /* 专注度管理*/
        $pid = DB::table('permissions')->insertGetId([
            'pid' => 0,
            'title' => '专注度管理',
            'name' => '',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '专注度分类',
            'name' => 'attention/index',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '专注度记录',
            'name' => 'attention/record',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '专注度记录导出',
            'name' => 'attention/export',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        /* 纪律管理*/
        $pid = DB::table('permissions')->insertGetId([
            'pid' => 0,
            'title' => '纪律管理',
            'name' => '',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '纪律分类',
            'name' => 'discipline/index',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '纪律记录',
            'name' => 'discipline/record',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '纪律记录导出',
            'name' => 'discipline/export',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        /* 积极性管理*/
        $pid = DB::table('permissions')->insertGetId([
            'pid' => 0,
            'title' => '积极性管理',
            'name' => '',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '积极性分类',
            'name' => 'enthusiasm/index',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '积极性记录',
            'name' => 'enthusiasm/record',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '积极性记录导出',
            'name' => 'enthusiasm/export',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        /* 达人管理*/
        $pid = DB::table('permissions')->insertGetId([
            'pid' => 0,
            'title' => '校园焦点',
            'name' => '',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '达人分类',
            'name' => 'master/index',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '达人记录',
            'name' => 'master/record',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '达人记录导出',
            'name' => 'master/export',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);


        /* 数据库管理权限*/
        $pid = DB::table('permissions')->insertGetId([
            'pid' => 0,
            'title' => '数据库管理',
            'name' => '',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '数据库管理',
            'name' => 'database/index',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '数据库备份',
            'name' => 'database/backup',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '数据库还原',
            'name' => 'database/restore',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '备份文件下载',
            'name' => 'database/download',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '备份文件删除',
            'name' => 'database/delete',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);

        /* 消息通知权限*/
        $pid = DB::table('permissions')->insertGetId([
            'pid' => 0,
            'title' => '消息通知',
            'name' => '',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '所有消息',
            'name' => 'notice/index',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '已读消息',
            'name' => 'notice/read',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '未读消息',
            'name' => 'notice/unread',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '查看消息',
            'name' => 'notice/view',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '删除消息',
            'name' => 'notice/delete',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        /* 消息通知权限*/
        $pid = DB::table('permissions')->insertGetId([
            'pid' => 0,
            'title' => '数据大屏',
            'name' => '',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
        DB::table('permissions')->insertGetId([
            'pid' => $pid,
            'title' => '数据大屏',
            'name' => 'datascan/index',
            'sort' => $sort++,
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);
    }
}
